package com.example.util;

public class StringUtil {

	public static String null2Str(Object value) {
		return value == null || "null".equals(value.toString()) ? "" : value.toString();
	}

	public static boolean isBlank(String s) {
		if ("null".equals(s)) {
			return true;
		}
		return s == null || s.trim().length() <= 0;
	}

	public static boolean isBlank(Object value) {
		String s = nullToString(value);
		return s == null || s.trim().length() <= 0;
	}

	public static String nullToString(Object value) {
		return value == null ? "" : value.toString();
	}

}
